package com.fz.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fz.core.BaseEntity;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;

/**
 * <p>
 * 存储用户和角色关联信息
 * </p>
 *
 * @author hyr
 * @since 2025-06-18
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("user_role")
public class UserRole extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 创建时间
     */
    private LocalDateTime createTime;

    /**
     * 修改时间
     */
    private LocalDateTime updateTime;

    /**
     * 用户ID（外键）
     */
    private Long userId;

    /**
     * 角色ID（外键）
     */
    private Long roleId;

    /**
     * 逻辑删除（1=删除）
     */
    private Integer isDeleted;

    public UserRole(Long userId, Long roleId) {
        this.userId = userId;
        this.roleId = roleId;
    }
}
